Skip to content

Latest commit

 

History

History
609 lines (445 loc) · 12.4 KB

File metadata and controls

609 lines (445 loc) · 12.4 KB

New Install

#!/usr/bin/env bash

# Check script.log for  error logs. Pipefail set. No clobber set.
set -Eeuo pipefail
set -o noclobber
# exec >script.log 2>&1
exec 2>script.log

Manual settings

Accessibility settings

  • Display scaling (if necessary)
  • natural scrolling (for touchpad)
  • disable pointer acceleration (if necessary)
  • Tap-to-click (Touchpad)
  • Numlock (Keyboard)

Install packages

Packages

Internet

  • [ ] clipgrab
  • [ ] dropbox
  • [ ] chromium
  • [X] google-chrome

Communication

  • [ ] telegram-desktop
  • [ ] signal-desktop
  • [ ] whatsapp-for-linux

Graphics and Media

  • [ ] haruna
  • [ ] inkscape
  • [ ] obs-studio
  • [ ] img2pdf
  • [ ] yt-dlp
  • [ ] tagspaces-bin
  • [ ] kamoso
  • [ ] ghostwriter
  • [ ] gsfonts
  • [ ] ocenaudio-bin
  • [ ] xaos
  • [ ] youtube-music-desktop

System

  • [ ] kdialog
  • [ ] base-devel
  • [ ] git
  • [ ] tree
  • [ ] update-grub
  • [ ] reflector
  • [ ] rsync
  • [ ] curl
  • [ ] ttf-jetbrains-mono
  • [ ] gparted
  • [ ] veracrypt
  • [ ] keepassxc
  • [ ] vim
  • [ ] dolphin-plugins
  • [ ] pavucontrol
  • [ ] appimagelauncher
  • [ ] nvidia-settings
  • [ ] kde-applications
  • [ ] ffmpegthumbs
  • [ ] kdeplasma-addons
  • [ ] qt6-imageformats
  • [ ] stacer-bin
  • [ ] nvidia-prime
  • [ ] glxinfo
  • [ ] virtualgl
  • [ ] zip
  • [ ] unzip
  • [ ] unrar
  • [ ] foremost
  • [ ] bluez
  • [ ] bluez-utils
  • [ ] bluedevil
  • [ ] ttf-meslo-nerd-font-powerlevel10k

Customizations

  • [ ] neofetch
  • [ ] fastfetch
  • [ ] lolcat
  • [ ] taplo-cli
  • [ ] jq
  • [ ] cmatrix
  • [ ] plasma6-applets-window-title
  • [ ] plasma-applet-window-buttons
  • [ ] ttf-ibm-plex
  • [ ] konsave
  • [ ] zsh
  • [ ] zsh-theme-powerlevel10k
  • [ ] procreate-thumbnailer-git

Development

  • [ ] rustup
  • [ ] emacs
  • [ ] just

Huge-Apps

  • [ ] github-desktop-bin
  • [ ] texstudio

AI

  • [ ] ollama
  • [X] gemini

Remove

  • [ ] vi
  • [X] discover

Test Apps

  • [ ] zip
  • [ ] cmatrix

Script to install packages

<<shebang_script>>

echo -e "\nThis error log is generated by packages.sh\n" >&2
read -r -a install_pkgs <<< "$install"
read -r -a remove_pkgs  <<< "$remove"

if (( ${#install_pkgs[@]} )); then
  echo "Installing packages:"
  printf '  + %s\n' "${install_pkgs[@]}"
  yay -S --needed "${install_pkgs[@]}"
fi

if (( ${#remove_pkgs[@]} )); then
  echo "Removing packages:"
  printf '  - %s\n' "${remove_pkgs[@]}"
  yay -Rns "${remove_pkgs[@]}"
fi

System Configuration

<<shebang_script>>

echo -e "\nThis error log is generated by system.sh\n" >&2

Enable bluetooth service to use a bluetooth keyboard

# Enable Bluetooth service.
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service

Configure pacman

  • Set number of parallel downloads by pacman = 20
    # Configure Pacman.
    cat /etc/pacman.conf
    sudo vim /etc/pacman.conf
        

Mount default volumes in fstab

  • Mount /dev/sda1 @ /media/DATA
# Mount /dev/sda1 using fstab
 sudo tee -a /etc/fstab < /run/media/DATA/SOFTWARE/Linux/DOTFILES/etc/fstab
 sudo mkdir -p /media/DATA /media/SAFE /media/STORM

 # # If using windows:
 # sudo mkdir -p /media/WINDOWS


 sudo chown -R devlinman:devlinman /media
 sudo umount /dev/sda1
 sudo systemctl daemon-reload
 sudo mount -a

GRUB config

  • update-grub
#!/usr/bin/env bash
set -e

sudo cp /media/DATA/SOFTWARE/Linux/DOTFILES/etc/default/grub /etc/default/grub
sudo cp -r /media/DATA/SOFTWARE/Linux/DOTFILES/usr/share/grub/manjaro /usr/share/grub/themes/
sudo grub-mkconfig -o /boot/grub/grub.cfg

Misc

# Disable this sevice for optimized boot times.
 sudo systemctl disable systemd-networkd-wait-online.service

# ownership of sddm config
 sudo chown -R sddm:sddm /var/lib/sddm/.config


# Create User Image.
# sudo cp ./config/devlinman.png /var/lib/AccountsService/icons/$USER
sudo cp ./config/devlinman.png /var/lib/AccountsService/icons/devlinman


# Copy konsave config file.
cp /media/DATA/SOFTWARE/Linux/DOTFILES/home/devlinman/.config/konsave/conf.yaml ~/.config/konsave/conf.yaml

Home directory

  • symlink [Applications, Desktop, Documents, Downloads, Music, Pictures, Templates, Vaults, Videos]
# Create symlinks for Home folders.
HOME_DIR="$HOME"

# ---- Directory list ----
DIRS=(
  Applications
  Desktop
  Documents
  Downloads
  Music
  Pictures
  Templates
  Vaults
  Videos
)

# ---- Destination mappings ----
# Default: /media/DATA/<DirName>
# Exceptions handled explicitly
declare -A DEST_MAP=(
  [Applications]="/media/DATA/SOFTWARE/Linux/Applications"
  [Desktop]="/media/DATA/Desktop"
  [Documents]="/media/DATA/Documents"
  [Downloads]="/media/Downloads"
  [Music]="/media/DATA/Music"
  [Pictures]="/media/DATA/Pictures"
  [Templates]="/media/DATA/Templates"
  [Vaults]="/media/DATA/Vaults"
  [Videos]="/media/DATA/Videos"
)

echo "==> Checking directory existence in ~"

missing_dirs=()

for dir in "${DIRS[@]}"; do
  if [[ ! -d "$HOME_DIR/$dir" ]]; then
    missing_dirs+=("$dir")
  fi
done

if (( ${#missing_dirs[@]} > 0 )); then
  echo "ERROR: Missing directories in ~:"
  for d in "${missing_dirs[@]}"; do
    echo "  - $d"
  done
  exit 1
fi

echo "All directories exist"

echo
echo "==> Checking that directories are empty"

non_empty_dirs=()

for dir in "${DIRS[@]}"; do
  if [[ -n "$(ls -A "$HOME_DIR/$dir")" ]]; then
    non_empty_dirs+=("$dir")
  fi
done

if (( ${#non_empty_dirs[@]} > 0 )); then
  echo "ERROR: The following directories are NOT empty:"
  for d in "${non_empty_dirs[@]}"; do
    echo
    echo "Contents of ~$d:"
    ls -A "$HOME_DIR/$d"
  done
  exit 1
fi

echo "All directories are empty"

echo
echo "==> Replacing directories with symlinks"

for dir in "${DIRS[@]}"; do
  src="$HOME_DIR/$dir"
  dest="${DEST_MAP[$dir]}"

  if [[ -z "$dest" ]]; then
    echo "ERROR: No destination defined for $dir"
    exit 1
  fi

  echo "Linking ~$dir -> $dest"

  rmdir "$src"
  ln -s "$dest" "$src"
done

echo
echo "All directories successfully replaced with symlinks"

Customize

<<shebang_script>>

echo -e "\nThis error log is generated by custom.sh\n" >&2

Retrieve dotfiles (may use GNU Stow)

# Konsave
konsave -i /media/DATA/SOFTWARE/Programming/KONSAVE/Monark.knsv
konsave -a Monark

Install Local Applications

REN

# Install REN
PROJECT_DIR="/media/DATA/SOFTWARE/Programming/Projects"

sudo make -C "$PROJECT_DIR/REN" install

Set environment variables

  • For apps like keepassXc to follow the cursor theme.
XCURSOR_THEME=Qogir-Dark
XCURSOR_SIZE=32
# Create /etc/environment
sudo mv -i environment /etc/

SDDM

  • An example config can be generated by: sddm --example-config
[General]
Numlock=on

[Wayland]
EnableHiDPI=true
SessionLogFile=.local/share/sddm/wayland-session.log


[Theme]
CursorTheme=Qogir-Dark
CursorSize=32
# Create sddm.conf
# sudo mv sddm.conf /etc/sddm.conf.d/cursor-theme.conf
sudo mv -i sddm.conf /etc/sddm.conf

Development

<<shebang_script>>

echo -e "\nThis error log is generated by dev.sh\n" >&2

AUR SSH Keys

  • keepassXc has AUR tokens
# Create AUR SSH keys.
touch ~/.ssh/aur.pub
touch ~/.ssh/aur
# Add the keys manually.

# Create ssh config
touch ~/.ssh/config
echo -e "Host aur.archlinux.org aur
HostName aur.archlinux.org
User aur
IdentityFile ~/.ssh/aur
IdentitiesOnly yes" > ~/.ssh/config

Install rust toolchain

# Rust Toolchain
if ! command -v rustup >/dev/null 2>&1; then
    yay -S --noconfirm rustup
fi

rustup default stable
rustup component add rustfmt clippy

emacs

  • Add doom to $PATH in .zshrc - located at: /home/devlinman/.config/emacs/bin/doom
# Emacs
if ! command -v emacs >/dev/null 2>&1; then
    yay -S --noconfirm emacs
fi
git clone https://github.com/doomemacs/doomemacs ~/.config/emacs
~/.config/emacs/bin/doom install
~/.config/emacs/bin/doom sync
  • Install fonts for proper rendering of icons.
  • When it misbehaves:

killall emacs

  • autostart emacs --daemon on login and use emacs client.
[Desktop Entry]
Categories=Development;TextEditor;
Comment=Run Emacs server daemon.
Exec=emacs --daemon
GenericName=Text Editor
Icon=emacs
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Name=Emacs
StartupNotify=true
StartupWMClass=Emacs
Terminal=false
Type=Application

# Create autostart for emacs daemon
# Set permissions...first.
mv emacs_daemon.desktop ~/.config/autostart/

Execute & Permissions

Emacs Lisp to Install Packages

  • Must run C-c, C-c on this block before org-babel-tangle.
(require 'org)
(require 'subr-x)

(defun my/org-packages-install ()
  "Return unchecked packages under ** Packages, excluding *** Remove."
  (save-excursion
    (goto-char (point-min))

    ;; Narrow to ** Packages
    (unless (re-search-forward "^\\*\\* Packages\\b" nil t)
      (error "No '** Packages' section found"))
    (beginning-of-line)
    (org-narrow-to-subtree)

    ;; Find Remove subtree boundaries
    (let (remove-start remove-end)
      (save-excursion
        (when (re-search-forward "^\\*\\*\\* Remove\\b" nil t)
          (setq remove-start (line-beginning-position))
          (org-end-of-subtree)
          (setq remove-end (point))))

      ;; Collect unchecked list items, skipping Remove region
      (let (pkgs)
        (goto-char (point-min))
        (while (re-search-forward "^- \\[ \\] \\(.*\\)$" nil t)
          (let ((pos (match-beginning 0)))
            (unless (and remove-start
                         (>= pos remove-start)
                         (< pos remove-end))
              (push (match-string 1) pkgs))))
        (widen)
        (string-join (delete-dups (nreverse pkgs)) " ")))))

(defun my/org-packages-remove ()
  "Return unchecked packages under *** Remove."
  (save-excursion
    (goto-char (point-min))
    (unless (re-search-forward "^\\*\\*\\* Remove\\b" nil t)
      (error "No '*** Remove' section found"))
    (beginning-of-line)
    (org-narrow-to-subtree)

    (let (pkgs)
      (while (re-search-forward "^- \\[ \\] \\(.*\\)$" nil t)
        (push (match-string 1) pkgs))
      (widen)
      (string-join (delete-dups (nreverse pkgs)) " "))))
(my/org-packages-install)
(my/org-packages-remove)
  • Bug or feature? You need to run C-c, C-c on this block too. It may give an error, but it will get the variables, though.
# packages from org file.
<<packages_script>>
  • Now run C-c, C-v, t to tangle.

Set file permissions

  • Press C-c,C-c to run this block.
#!/usr/bin/env bash

chmod -R -v +x scripts/

# ./scripts/system.sh
# ./scripts/packages.sh
# ./scripts/grub.sh
# ./scripts/custom.sh
# ./scripts/dev.sh